package com.gxg.services;

import java.net.InetAddress;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class PingService
{
  @Value("${ping.timeout}")
  private int pingTimeout;
  
  public Boolean ping(String ipAddress)
    throws Exception
  {
    return Boolean.valueOf(InetAddress.getByName(ipAddress).isReachable(this.pingTimeout));
  }
}
